<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/commonJS.jsp" %>
<%@ include file="../common/commonLabel.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>采购付款信息列表</title>
</head>
<script type="text/javascript">

function doIns(){
	document.all["operate"].value = "inspage";
	document.forms[0].submit();
}

function doDeltype(cid){
	if(confirm("确定删除该供应商吗？")){
		document.all["tpid"].value = cid;
		document.all["operate"].value = "delinfo";
		document.forms[0].submit();
	}
}

function doUpdType(cid){
	document.all["tpid"].value = cid;
	document.all["operate"].value = "updpage";
	document.forms[0].submit();
}
function doSelinfo(cid){
	document.all["tpid"].value = cid;
	document.all["operate"].value = "selpage";
	document.forms[0].submit();
}
</script>
<body>
<form action="<%=path %>/paymoney.action" method="post" >
<table width="85%" border="0" cellpadding="0" cellspacing="0" >
  <tr>
     <td>
     <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="MainBody">
		<tr>
    		<td width="760" class="MainBody_title"><hello:forValue type="title" /></td>
    		<td></td>
		</tr>
      <tr>
        <td valign="top" colspan="2">
        <table border="0" cellspacing="0" cellpadding="0" style="margin: 5px 0 10px 20px;width:90%">
			<tr height="35">
				<td align="right" ><input name="tpid" type="hidden" value=""/><input name="operate" type="hidden" value=""/></td>
				<td align="right" ><input type="button" value="查询" class="btn" onclick="doSel()"/>
				&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="添 加" class="btn" onclick="doIns()"/>&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="button" value="打 印" class="btn" onclick="doIns()"/></td>
			</tr>
			<tr >
				<td colspan="2" class="box01">
				<SPAN>供应商名称：<input type="text" name="suppliername" value="${suppliername}" maxlength="30"></SPAN>
				<SPAN>付款人：<input type="text" name="tpperson" value="${tpperson}" maxlength="30"></SPAN>
				<SPAN>付款日期：<input type="text" name="begin" value="${begin}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:false})" class="Wdate" maxlength="30">
				&nbsp;&nbsp;至&nbsp;&nbsp;<input type="text" name="end" value="${end}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:false})" class="Wdate" maxlength="30"></SPAN>
				<SPAN>付款方式：<input type="text" name="tpway" value="${tpway}" maxlength="30"></SPAN>
				</td>
			</tr>
		</table>
        <table border="0" cellpadding="0" cellspacing="0"  class="MainBody_table">
           <tr>
				<th width="18%" nowrap="nowrap">供应商名称</th>
				<th width="7%" nowrap="nowrap">付款人</th>
				<th width="8%" nowrap="nowrap">付款日期</th>
				<th width="8%" nowrap="nowrap">应付金额</th>
				<th width="8%" nowrap="nowrap">实付金额</th>
				<th width="8%" nowrap="nowrap">付款方式</th>
				<th width="8%" nowrap="nowrap">未付金额</th>
				<th width="8%" nowrap="nowrap">发票类型</th>
				<th width="10%" nowrap="nowrap">发票号</th>
				<th width="8%" nowrap="nowrap">发票金额</th>
				<th width="12%" nowrap="nowrap">操作</th>
			</tr>
			<c:forEach items="${listinfo}" varStatus="status" var="rows">
			<tr>
				<td nowrap="nowrap"><a href="#" title="供应商详细信息" onclick="doSelinfo('${rows.tpid}')">${rows.suppliername}</a></td>
				<td nowrap="nowrap">${rows.tpperson}</td>
				<td nowrap="nowrap">${rows.tpdate}</td>
				<td nowrap="nowrap">${rows.tpmoney}</td>
				<td nowrap="nowrap"><font color="green" style="font-weight: bold">${rows.realmoney}</font></td>
				<td nowrap="nowrap">${rows.tpway}</td>
				<td nowrap="nowrap"><font color="red" style="font-weight: bold">${rows.tpmoney-rows.realmoney}</font></td>
				<td nowrap="nowrap">${rows.billtype}</td>
				<td nowrap="nowrap">${rows.bill}</td>
				<td nowrap="nowrap"><font color="olive">${rows.billmoney}</font></td>
				<td nowrap="nowrap">
				<span class='RoleSpan' onclick="doUpdType('${rows.tpid}')" title='修改采购付款信息' style='color: green;' onmouseout="doMsOut('green')" onmouseover='doMsOver()'>修改</span>&nbsp;&nbsp;
				<c:if test="${rows.finalflag != '已结算'}">
				<span class='RoleSpan' onclick="doDeltype('${rows.tpid}')" title='删除该采购付款信息' style='color: red;' onmouseout="doMsOut('red')" onmouseover='doMsOver()'>删除</span>
				</c:if>
				</td> 
			</tr>
			</c:forEach>
		<c:if test="${empty listinfo}">
			<tr>
				<td colspan="11" align="center">暂时没有您可以浏览的数据</td>
			</tr>
		</c:if>
          </table>
          <c:if test="${!empty listinfo}">
          <table border="0" cellpadding="0" cellspacing="0" class="MainBody_fun">
            <tr>
              <td>
               <hello:AllPage />
			  </td>
            </tr>
          </table>
          </c:if>
          </td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>